<?php
/**
 * Created by PhpStorm.
 * User: hyl
 * Date: 2021/10/31
 * Time: 14:43
 */

class UnionCode
{

    static public function orderId()
    {
        return date('Ymd').substr(implode(NULL, array_map('ord', str_split(substr(uniqid(), 7, 13), 1))), 0, 8);
    }

    static public function partnerTradeNo()
    {
        $d = explode(" ", microtime());
        return date('YmdHis').substr($d[0], 4).rand(1000000000, $d[1]);
    }

    static public function verificationCode()
    {
        return md5(self::orderId());
    }
}
